<html>
<head><meta charset="utf-8"><title>Define &quot;tuple type&quot;? · t-lang/doc · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/index.html">t-lang/doc</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/Define.20.22tuple.20type.22.3F.html">Define &quot;tuple type&quot;?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="215675511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/Define%20%22tuple%20type%22%3F/near/215675511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> isHavvy <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/Define.20.22tuple.20type.22.3F.html#215675511">(Nov 05 2020 at 06:39)</a>:</h4>
<p>I'm trying, with difficulty, to define what the tuple type is. I think part of my problem is how do we define what a type actually is? This is stopping me from actually submitting a PR with a bunch of updates on tuples for the reference. So, what are y'alls thoughts on the following definition?</p>
<blockquote>
<p>The <em>tuple type</em> is a structural type for heterogeneous lists of other types. Each entry in the list is an <em>element</em> of the tuple. The position of the element makes it the <em>nth element</em> using zero (0) as the initial index.</p>
</blockquote>



<a name="215676205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/Define%20%22tuple%20type%22%3F/near/215676205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> isHavvy <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/Define.20.22tuple.20type.22.3F.html#215676205">(Nov 05 2020 at 06:54)</a>:</h4>
<p>Actually, I like this definition. I'm going to go with it.</p>



<a name="215763621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/Define%20%22tuple%20type%22%3F/near/215763621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/Define.20.22tuple.20type.22.3F.html#215763621">(Nov 05 2020 at 19:39)</a>:</h4>
<p><span class="user-mention" data-user-id="296643">@isHavvy</span> seems ok, maybe a bit "jargon-heavy". I guess I might have leaned on something like "anonymous struct", but maybe that's confusing given that the fields are numbered.</p>



<a name="215777101"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/Define%20%22tuple%20type%22%3F/near/215777101" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> isHavvy <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/Define.20.22tuple.20type.22.3F.html#215777101">(Nov 05 2020 at 21:32)</a>:</h4>
<p>The reference ends up being jargon heavy in general. There's a lot of terms to be defined. And this paragraph is focused on defining the jargon.</p>



<a name="215871187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/Define%20%22tuple%20type%22%3F/near/215871187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/Define.20.22tuple.20type.22.3F.html#215871187">(Nov 06 2020 at 16:39)</a>:</h4>
<p><span class="user-mention" data-user-id="296643">@isHavvy</span> ok.</p>



<a name="215953032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/Define%20%22tuple%20type%22%3F/near/215953032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/Define.20.22tuple.20type.22.3F.html#215953032">(Nov 07 2020 at 12:34)</a>:</h4>
<p>if you like jargon, it might be worth bringing up "product type" (that's the type theory name for this)</p>



<a name="215972249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/Define%20%22tuple%20type%22%3F/near/215972249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> isHavvy <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/Define.20.22tuple.20type.22.3F.html#215972249">(Nov 07 2020 at 20:34)</a>:</h4>
<p>Hmm, perhaps. Though if I do that, I'd want to do that to all of the sum and product types at the same time.</p>



<a name="215972753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/Define%20%22tuple%20type%22%3F/near/215972753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/Define.20.22tuple.20type.22.3F.html#215972753">(Nov 07 2020 at 20:46)</a>:</h4>
<p>fair</p>



<a name="216399864"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/Define%20%22tuple%20type%22%3F/near/216399864" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/Define.20.22tuple.20type.22.3F.html#216399864">(Nov 11 2020 at 21:15)</a>:</h4>
<p>'if you like jargon' :)</p>



<a name="216587898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/Define%20%22tuple%20type%22%3F/near/216587898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/Define.20.22tuple.20type.22.3F.html#216587898">(Nov 13 2020 at 09:44)</a>:</h4>
<p>I think (technical, precise) jargon can be useful, but it has to be used carefully ;)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>